#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>

int un_g_val;

int g_val = 100;

int main(int argc, char *argv[])
{
    printf("text: %p\n", main);
    printf("init: %p\n", &g_val);
    printf("uninit: %p\n", &un_g_val);

    char *p1 = (char*)malloc(16);
    char *p2 = (char*)malloc(16);
    char *p3 = (char*)malloc(16);
    char *p4 = (char*)malloc(16);

    printf("heap: %p\n", p1);
    printf("heap: %p\n", p2);
    printf("heap: %p\n", p3);
    printf("heap: %p\n", p4);

    printf("stack: %p\n", &p1);
    printf("stack: %p\n", &p2);
    printf("stack: %p\n", &p3);
    printf("stack: %p\n", &p4);

    return 0;
}
